<!DOCTYPE html>
<html>
  <head>
    <%- include('head',{title:'首页'})%>
  </head>
  <body>
    <%- include('bar',{username:data.username})%>

    <div class="list">
      
       <% data.list.map((ele,index)=>{%>
        <div class="row">
          <span><%=(index+1)%></span>
          <span><%=ele.username%></span>
          <span><a href="/detail?id=<%=ele._id%>"><%=ele.title%></a></span>
          <span><%=ele.createTimeZH%></span>
          
          <%if(ele.username==data.username){%>
          <span>
            <a href="/write?id=<%=ele._id%>">编辑</a>
            <a href="/articles/delete?id=<%=ele._id%>">删除</a>
          </span>
          <%}%>
          
        </div>
      <%})%>
      <div class="pages">
        <%for(var i=1;i<=data.total;i++){%>
          <a href="/?page=<%=i%>"><%=i%></a>
        <%}%>
      </div>

    </div>
  </body>
</html>
